/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

监控项自定义监控相关接口
自定义监控项相关接口，提供自定义监控数据上报功能

OpenAPI spec version: v2
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>
#import <JDCloudOCSDKMonitor/MonitorApiModel.h>


@implementation MonitorDescribeMetricsRequest
-(id) initWithRegion:(NSString *)regionId
serviceCode:(NSString*)serviceCode
type:(NSNumber*)type { 
    self.regionId = regionId;
    self.serviceCode = serviceCode;
    self.type = type;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
serviceCode:(NSString*)serviceCode
type:(NSNumber*)type { 
    self.regionId = regionId;
    self.version = version;
    self.serviceCode = serviceCode;
    self.type = type;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.type = [dictionary objectForKey:@"type"];
    return self;
} 

@end
@implementation MonitorDeleteAlarmsRequest
-(id) initWithRegion:(NSString *)regionId
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.alarmId = alarmId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.version = version;
    self.alarmId = alarmId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    return self;
} 

@end
@implementation MonitorDescribeAlarmContactsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
referenceType:(NSNumber*)referenceType
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.referenceType = referenceType;
    self.alarmId = alarmId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
referenceType:(NSNumber*)referenceType
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.referenceType = referenceType;
    self.alarmId = alarmId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self referenceType])
    {
        [result setValue:[self referenceType] forKey:@"referenceType"];
    }
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.referenceType = [dictionary objectForKey:@"referenceType"];
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    return self;
} 

@end
@implementation MonitorDeleteAlarmsResult
-(id) initWithSuccess:(NSNumber*) success { 
    self.success = success;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self success])
    {
        [result setValue:[self success] forKey:@"success"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.success = [dictionary objectForKey:@"success"];
    return self;
} 

@end
@implementation MonitorUpdateAlarmResult
-(id) initWithAlarmId:(NSString*) alarmId
        success:(NSNumber*)success { 
    self.alarmId = alarmId;               
    self.success = success;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    if([self success])
    {
        [result setValue:[self success] forKey:@"success"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    self.success = [dictionary objectForKey:@"success"];
    return self;
} 

@end
@implementation MonitorCreateAlarmResult
-(id) initWithAlarmId:(NSString*) alarmId { 
    self.alarmId = alarmId;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    return self;
} 

@end
@implementation MonitorEnableAlarmsResult
-(id) initWithSuccess:(NSNumber*) success { 
    self.success = success;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self success])
    {
        [result setValue:[self success] forKey:@"success"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.success = [dictionary objectForKey:@"success"];
    return self;
} 

@end
@implementation MonitorDescribeMetricsForAlarmRequest
-(id) initWithRegion:(NSString *)regionId
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
metricType:(NSNumber*)metricType { 
    self.regionId = regionId;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.metricType = metricType;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
metricType:(NSNumber*)metricType { 
    self.regionId = regionId;
    self.version = version;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.metricType = metricType;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self metricType])
    {
        [result setValue:[self metricType] forKey:@"metricType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.product = [dictionary objectForKey:@"product"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.metricType = [dictionary objectForKey:@"metricType"];
    return self;
} 

@end
@implementation MonitorDescribeProductsForAlarmRequest
-(id) initWithRegion:(NSString *)regionId
serviceCode:(NSString*)serviceCode
product:(NSString*)product { 
    self.regionId = regionId;
    self.serviceCode = serviceCode;
    self.product = product;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
serviceCode:(NSString*)serviceCode
product:(NSString*)product { 
    self.regionId = regionId;
    self.version = version;
    self.serviceCode = serviceCode;
    self.product = product;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.product = [dictionary objectForKey:@"product"];
    return self;
} 

@end
@implementation MonitorEnableAlarmsRequest
-(id) initWithRegion:(NSString *)regionId
alarmIds:(NSArray<NSString*>*)alarmIds
state:(NSNumber*)state { 
    self.regionId = regionId;
    self.alarmIds = alarmIds;
    self.state = state;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
alarmIds:(NSArray<NSString*>*)alarmIds
state:(NSNumber*)state { 
    self.regionId = regionId;
    self.version = version;
    self.alarmIds = alarmIds;
    self.state = state;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self alarmIds])
    {
        [result setValue:[self alarmIds] forKey:@"alarmIds"];
    }
    if([self state])
    {
        [result setValue:[self state] forKey:@"state"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmIds = [dictionary objectForKey:@"alarmIds"];
    self.state = [dictionary objectForKey:@"state"];
    return self;
} 

@end
@implementation MonitorDescribeAlarmRequest
-(id) initWithRegion:(NSString *)regionId
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.alarmId = alarmId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.version = version;
    self.alarmId = alarmId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    return self;
} 

@end
@implementation MonitorDescribeMetricsResult
-(id) initWithMetrics:(NSArray<MetricDetail*>*) metrics { 
    self.metrics = metrics;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metrics])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self metrics] count]; i++) {
            MetricDetail* item = [[self metrics] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"metrics"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* metricsArray = [dictionary objectForKey:@"metrics"];
    if(metricsArray&&![metricsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [metricsArray count];i++)
        {
        MetricDetail* item = [[MetricDetail alloc]initWithDic:[metricsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.metrics = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorDescribeMetricsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeMetricsResult* result = [[MonitorDescribeMetricsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeMetricsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorLastDownsampleRequest
-(id) initWithRegion:(NSString *)regionId
serviceCode:(NSString*)serviceCode
dimension:(NSString*)dimension
resourceId:(NSString*)resourceId
tags:(NSArray<MonitorTagFilter*>*)tags
startTime:(NSString*)startTime
endTime:(NSString*)endTime
timeInterval:(NSString*)timeInterval
aggrType:(NSString*)aggrType
downAggrType:(NSString*)downAggrType
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.serviceCode = serviceCode;
    self.dimension = dimension;
    self.resourceId = resourceId;
    self.tags = tags;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.aggrType = aggrType;
    self.downAggrType = downAggrType;
    self.metric = metric;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
serviceCode:(NSString*)serviceCode
dimension:(NSString*)dimension
resourceId:(NSString*)resourceId
tags:(NSArray<MonitorTagFilter*>*)tags
startTime:(NSString*)startTime
endTime:(NSString*)endTime
timeInterval:(NSString*)timeInterval
aggrType:(NSString*)aggrType
downAggrType:(NSString*)downAggrType
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.version = version;
    self.serviceCode = serviceCode;
    self.dimension = dimension;
    self.resourceId = resourceId;
    self.tags = tags;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.aggrType = aggrType;
    self.downAggrType = downAggrType;
    self.metric = metric;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self tags])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self tags] count]; i++) {
            MonitorTagFilter* item = [[self tags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"tags"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self timeInterval])
    {
        [result setValue:[self timeInterval] forKey:@"timeInterval"];
    }
    if([self aggrType])
    {
        [result setValue:[self aggrType] forKey:@"aggrType"];
    }
    if([self downAggrType])
    {
        [result setValue:[self downAggrType] forKey:@"downAggrType"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    NSArray* tagsArray = [dictionary objectForKey:@"tags"];
    if(tagsArray&&![tagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [tagsArray count];i++)
        {
        MonitorTagFilter* item = [[MonitorTagFilter alloc]initWithDic:[tagsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.tags = propertyArray;
    }
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.timeInterval = [dictionary objectForKey:@"timeInterval"];
    self.aggrType = [dictionary objectForKey:@"aggrType"];
    self.downAggrType = [dictionary objectForKey:@"downAggrType"];
    self.metric = [dictionary objectForKey:@"metric"];
    return self;
} 

@end
@implementation MonitorDescribeMetricDataResult
-(id) initWithMetricDatas:(NSArray<MetricData*>*) metricDatas { 
    self.metricDatas = metricDatas;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metricDatas])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self metricDatas] count]; i++) {
            MetricData* item = [[self metricDatas] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"metricDatas"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* metricDatasArray = [dictionary objectForKey:@"metricDatas"];
    if(metricDatasArray&&![metricDatasArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [metricDatasArray count];i++)
        {
        MetricData* item = [[MetricData alloc]initWithDic:[metricDatasArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.metricDatas = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorDescribeMetricDataResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeMetricDataResult* result = [[MonitorDescribeMetricDataResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeMetricDataResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeMetricDataRequest
-(id) initWithRegion:(NSString *)regionId
aggrType:(NSString*)aggrType
downSampleType:(NSString*)downSampleType
startTime:(NSString*)startTime
endTime:(NSString*)endTime
timeInterval:(NSString*)timeInterval
tags:(NSArray<MonitorTagFilter*>*)tags
groupBy:(NSNumber*)groupBy
rate:(NSNumber*)rate
serviceCode:(NSString*)serviceCode
dimension:(NSString*)dimension
resourceId:(NSString*)resourceId
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.aggrType = aggrType;
    self.downSampleType = downSampleType;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.tags = tags;
    self.groupBy = groupBy;
    self.rate = rate;
    self.serviceCode = serviceCode;
    self.dimension = dimension;
    self.resourceId = resourceId;
    self.metric = metric;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
aggrType:(NSString*)aggrType
downSampleType:(NSString*)downSampleType
startTime:(NSString*)startTime
endTime:(NSString*)endTime
timeInterval:(NSString*)timeInterval
tags:(NSArray<MonitorTagFilter*>*)tags
groupBy:(NSNumber*)groupBy
rate:(NSNumber*)rate
serviceCode:(NSString*)serviceCode
dimension:(NSString*)dimension
resourceId:(NSString*)resourceId
metric:(NSString*)metric { 
    self.regionId = regionId;
    self.version = version;
    self.aggrType = aggrType;
    self.downSampleType = downSampleType;
    self.startTime = startTime;
    self.endTime = endTime;
    self.timeInterval = timeInterval;
    self.tags = tags;
    self.groupBy = groupBy;
    self.rate = rate;
    self.serviceCode = serviceCode;
    self.dimension = dimension;
    self.resourceId = resourceId;
    self.metric = metric;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self aggrType])
    {
        [result setValue:[self aggrType] forKey:@"aggrType"];
    }
    if([self downSampleType])
    {
        [result setValue:[self downSampleType] forKey:@"downSampleType"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self timeInterval])
    {
        [result setValue:[self timeInterval] forKey:@"timeInterval"];
    }
    if([self tags])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self tags] count]; i++) {
            MonitorTagFilter* item = [[self tags] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"tags"];
    }
    if([self groupBy])
    {
        [result setValue:[self groupBy] forKey:@"groupBy"];
    }
    if([self rate])
    {
        [result setValue:[self rate] forKey:@"rate"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self metric])
    {
        [result setValue:[self metric] forKey:@"metric"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.aggrType = [dictionary objectForKey:@"aggrType"];
    self.downSampleType = [dictionary objectForKey:@"downSampleType"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.timeInterval = [dictionary objectForKey:@"timeInterval"];
    NSArray* tagsArray = [dictionary objectForKey:@"tags"];
    if(tagsArray&&![tagsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [tagsArray count];i++)
        {
        MonitorTagFilter* item = [[MonitorTagFilter alloc]initWithDic:[tagsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.tags = propertyArray;
    }
    self.groupBy = [dictionary objectForKey:@"groupBy"];
    self.rate = [dictionary objectForKey:@"rate"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.metric = [dictionary objectForKey:@"metric"];
    return self;
} 

@end
@implementation MonitorDescribeServicesResult
-(id) initWithServices:(NSArray<ServiceInfoV2*>*) services { 
    self.services = services;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self services])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self services] count]; i++) {
            ServiceInfoV2* item = [[self services] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"services"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* servicesArray = [dictionary objectForKey:@"services"];
    if(servicesArray&&![servicesArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [servicesArray count];i++)
        {
        ServiceInfoV2* item = [[ServiceInfoV2 alloc]initWithDic:[servicesArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.services = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorDescribeServicesResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeServicesResult* result = [[MonitorDescribeServicesResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeServicesResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorLastDownsampleResult
-(id) initWithItems:(NSArray<LastDownsampleRespItem*>*) items { 
    self.items = items;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self items])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self items] count]; i++) {
            LastDownsampleRespItem* item = [[self items] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"items"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* itemsArray = [dictionary objectForKey:@"items"];
    if(itemsArray&&![itemsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [itemsArray count];i++)
        {
        LastDownsampleRespItem* item = [[LastDownsampleRespItem alloc]initWithDic:[itemsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.items = propertyArray;
    }
    return self;
} 

@end
@implementation MonitorDescribeServicesRequest
-(id) initWithRegion:(NSString *)regionId
filters:(NSArray<MonitorFilter*>*)filters
productType:(NSNumber*)productType { 
    self.regionId = regionId;
    self.filters = filters;
    self.productType = productType;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
filters:(NSArray<MonitorFilter*>*)filters
productType:(NSNumber*)productType { 
    self.regionId = regionId;
    self.version = version;
    self.filters = filters;
    self.productType = productType;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            MonitorFilter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    if([self productType])
    {
        [result setValue:[self productType] forKey:@"productType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        MonitorFilter* item = [[MonitorFilter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    self.productType = [dictionary objectForKey:@"productType"];
    return self;
} 

@end
  
@implementation MonitorLastDownsampleResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorLastDownsampleResult* result = [[MonitorLastDownsampleResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorLastDownsampleResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeProductsForAlarmResult
-(id) initWithProductList:(NSArray<Product*>*) productList { 
    self.productList = productList;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self productList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self productList] count]; i++) {
            Product* item = [[self productList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"productList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* productListArray = [dictionary objectForKey:@"productList"];
    if(productListArray&&![productListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [productListArray count];i++)
        {
        Product* item = [[Product alloc]initWithDic:[productListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.productList = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorDescribeProductsForAlarmResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeProductsForAlarmResult* result = [[MonitorDescribeProductsForAlarmResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeProductsForAlarmResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation MonitorUpdateAlarmResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorUpdateAlarmResult* result = [[MonitorUpdateAlarmResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorUpdateAlarmResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeAlarmResult
-(id) initWithAlarmId:(NSString*) alarmId
        alarmStatus:(NSNumber*)alarmStatus
        alarmStatusList:(NSArray<NSNumber*>*)alarmStatusList
        baseContact:(NSArray<BaseContact*>*)baseContact
        createTime:(NSString*)createTime
        dimension:(NSString*)dimension
        dimensionName:(NSString*)dimensionName
        enabled:(NSNumber*)enabled
        noticeOption:(NSArray<NoticeOption*>*)noticeOption
        product:(NSString*)product
        productName:(NSString*)productName
        resourceOption:(ResourceOption*)resourceOption
        ruleName:(NSString*)ruleName
        ruleOption:(RuleOptionDetail*)ruleOption
        ruleType:(NSString*)ruleType
        ruleVersion:(NSString*)ruleVersion
        tags:(NSMutableDictionary<NSString*,NSString*>*)tags
        webHookOption:(WebHookOption*)webHookOption { 
    self.alarmId = alarmId;               
    self.alarmStatus = alarmStatus;               
    self.alarmStatusList = alarmStatusList;               
    self.baseContact = baseContact;               
    self.createTime = createTime;               
    self.dimension = dimension;               
    self.dimensionName = dimensionName;               
    self.enabled = enabled;               
    self.noticeOption = noticeOption;               
    self.product = product;               
    self.productName = productName;               
    self.resourceOption = resourceOption;               
    self.ruleName = ruleName;               
    self.ruleOption = ruleOption;               
    self.ruleType = ruleType;               
    self.ruleVersion = ruleVersion;               
    self.tags = tags;               
    self.webHookOption = webHookOption;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    if([self alarmStatus])
    {
        [result setValue:[self alarmStatus] forKey:@"alarmStatus"];
    }
    if([self alarmStatusList])
    {
        [result setValue:[self alarmStatusList] forKey:@"alarmStatusList"];
    }
    if([self baseContact])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self baseContact] count]; i++) {
            BaseContact* item = [[self baseContact] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"baseContact"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self dimensionName])
    {
        [result setValue:[self dimensionName] forKey:@"dimensionName"];
    }
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self noticeOption])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self noticeOption] count]; i++) {
            NoticeOption* item = [[self noticeOption] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"noticeOption"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self productName])
    {
        [result setValue:[self productName] forKey:@"productName"];
    }
    if([self resourceOption])
    {
        [result setValue:[[self resourceOption] dictionary]forKey:@"resourceOption"];
    }
    if([self ruleName])
    {
        [result setValue:[self ruleName] forKey:@"ruleName"];
    }
    if([self ruleOption])
    {
        [result setValue:[[self ruleOption] dictionary]forKey:@"ruleOption"];
    }
    if([self ruleType])
    {
        [result setValue:[self ruleType] forKey:@"ruleType"];
    }
    if([self ruleVersion])
    {
        [result setValue:[self ruleVersion] forKey:@"ruleVersion"];
    }
    if([self tags])
    {
        [result setValue:[self tags] forKey:@"tags"];
    }
    if([self webHookOption])
    {
        [result setValue:[[self webHookOption] dictionary]forKey:@"webHookOption"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    self.alarmStatus = [dictionary objectForKey:@"alarmStatus"];
    self.alarmStatusList = [dictionary objectForKey:@"alarmStatusList"];
    NSArray* baseContactArray = [dictionary objectForKey:@"baseContact"];
    if(baseContactArray&&![baseContactArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [baseContactArray count];i++)
        {
        BaseContact* item = [[BaseContact alloc]initWithDic:[baseContactArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.baseContact = propertyArray;
    }
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.dimensionName = [dictionary objectForKey:@"dimensionName"];
    self.enabled = [dictionary objectForKey:@"enabled"];
    NSArray* noticeOptionArray = [dictionary objectForKey:@"noticeOption"];
    if(noticeOptionArray&&![noticeOptionArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [noticeOptionArray count];i++)
        {
        NoticeOption* item = [[NoticeOption alloc]initWithDic:[noticeOptionArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.noticeOption = propertyArray;
    }
    self.product = [dictionary objectForKey:@"product"];
    self.productName = [dictionary objectForKey:@"productName"];
    self.resourceOption = [[ResourceOption alloc]initWithDic:[dictionary objectForKey:@"resourceOption"]];
    self.ruleName = [dictionary objectForKey:@"ruleName"];
    self.ruleOption = [[RuleOptionDetail alloc]initWithDic:[dictionary objectForKey:@"ruleOption"]];
    self.ruleType = [dictionary objectForKey:@"ruleType"];
    self.ruleVersion = [dictionary objectForKey:@"ruleVersion"];
    self.tags = [dictionary objectForKey:@"tags"];
    self.webHookOption = [[WebHookOption alloc]initWithDic:[dictionary objectForKey:@"webHookOption"]];
    return self;
} 

@end
  
@implementation MonitorDescribeAlarmResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeAlarmResult* result = [[MonitorDescribeAlarmResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeAlarmResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeAlarmHistoryResult
-(id) initWithAlarmHistoryList:(NSArray<DescribedAlarmHistory*>*) alarmHistoryList
        numberPages:(NSNumber*)numberPages
        numberRecords:(NSNumber*)numberRecords
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize { 
    self.alarmHistoryList = alarmHistoryList;               
    self.numberPages = numberPages;               
    self.numberRecords = numberRecords;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmHistoryList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self alarmHistoryList] count]; i++) {
            DescribedAlarmHistory* item = [[self alarmHistoryList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"alarmHistoryList"];
    }
    if([self numberPages])
    {
        [result setValue:[self numberPages] forKey:@"numberPages"];
    }
    if([self numberRecords])
    {
        [result setValue:[self numberRecords] forKey:@"numberRecords"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* alarmHistoryListArray = [dictionary objectForKey:@"alarmHistoryList"];
    if(alarmHistoryListArray&&![alarmHistoryListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [alarmHistoryListArray count];i++)
        {
        DescribedAlarmHistory* item = [[DescribedAlarmHistory alloc]initWithDic:[alarmHistoryListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.alarmHistoryList = propertyArray;
    }
    self.numberPages = [dictionary objectForKey:@"numberPages"];
    self.numberRecords = [dictionary objectForKey:@"numberRecords"];
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    return self;
} 

@end
  
@implementation MonitorDescribeAlarmHistoryResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeAlarmHistoryResult* result = [[MonitorDescribeAlarmHistoryResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeAlarmHistoryResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation MonitorCreateAlarmResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorCreateAlarmResult* result = [[MonitorCreateAlarmResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorCreateAlarmResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeAlarmsResult
-(id) initWithAlarmList:(NSArray<DescribeGroupAlarm*>*) alarmList
        numberPages:(NSNumber*)numberPages
        numberRecords:(NSNumber*)numberRecords
        pageNumber:(NSNumber*)pageNumber
        pageSize:(NSNumber*)pageSize { 
    self.alarmList = alarmList;               
    self.numberPages = numberPages;               
    self.numberRecords = numberRecords;               
    self.pageNumber = pageNumber;               
    self.pageSize = pageSize;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self alarmList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self alarmList] count]; i++) {
            DescribeGroupAlarm* item = [[self alarmList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"alarmList"];
    }
    if([self numberPages])
    {
        [result setValue:[self numberPages] forKey:@"numberPages"];
    }
    if([self numberRecords])
    {
        [result setValue:[self numberRecords] forKey:@"numberRecords"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* alarmListArray = [dictionary objectForKey:@"alarmList"];
    if(alarmListArray&&![alarmListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [alarmListArray count];i++)
        {
        DescribeGroupAlarm* item = [[DescribeGroupAlarm alloc]initWithDic:[alarmListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.alarmList = propertyArray;
    }
    self.numberPages = [dictionary objectForKey:@"numberPages"];
    self.numberRecords = [dictionary objectForKey:@"numberRecords"];
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    return self;
} 

@end
  
@implementation MonitorDescribeAlarmsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeAlarmsResult* result = [[MonitorDescribeAlarmsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeAlarmsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeAlarmContactsResult
-(id) initWithContactsList:(NSArray<DescribedNoticeContacts*>*) contactsList
        total:(NSNumber*)total { 
    self.contactsList = contactsList;               
    self.total = total;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self contactsList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self contactsList] count]; i++) {
            DescribedNoticeContacts* item = [[self contactsList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"contactsList"];
    }
    if([self total])
    {
        [result setValue:[self total] forKey:@"total"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* contactsListArray = [dictionary objectForKey:@"contactsList"];
    if(contactsListArray&&![contactsListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [contactsListArray count];i++)
        {
        DescribedNoticeContacts* item = [[DescribedNoticeContacts alloc]initWithDic:[contactsListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.contactsList = propertyArray;
    }
    self.total = [dictionary objectForKey:@"total"];
    return self;
} 

@end
  
@implementation MonitorDescribeAlarmContactsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeAlarmContactsResult* result = [[MonitorDescribeAlarmContactsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeAlarmContactsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorDescribeMetricsForAlarmResult
-(id) initWithMetrics:(NSArray<RuleMetricDetail*>*) metrics { 
    self.metrics = metrics;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self metrics])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self metrics] count]; i++) {
            RuleMetricDetail* item = [[self metrics] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"metrics"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* metricsArray = [dictionary objectForKey:@"metrics"];
    if(metricsArray&&![metricsArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [metricsArray count];i++)
        {
        RuleMetricDetail* item = [[RuleMetricDetail alloc]initWithDic:[metricsArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.metrics = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorDescribeMetricsForAlarmResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDescribeMetricsForAlarmResult* result = [[MonitorDescribeMetricsForAlarmResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDescribeMetricsForAlarmResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
  
@implementation MonitorDeleteAlarmsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorDeleteAlarmsResult* result = [[MonitorDeleteAlarmsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorDeleteAlarmsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorUpdateAlarmRequest
-(id) initWithRegion:(NSString *)regionId
baseContact:(NSArray<BaseContact*>*)baseContact
dimension:(NSString*)dimension
enabled:(NSNumber*)enabled
noticeOption:(NSArray<NoticeOption*>*)noticeOption
product:(NSString*)product
resourceOption:(ResourceOption*)resourceOption
ruleName:(NSString*)ruleName
ruleOption:(RuleOption*)ruleOption
ruleType:(NSString*)ruleType
tags:(NSMutableDictionary<NSString*,NSString*>*)tags
webHookOption:(WebHookOption*)webHookOption
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.baseContact = baseContact;
    self.dimension = dimension;
    self.enabled = enabled;
    self.noticeOption = noticeOption;
    self.product = product;
    self.resourceOption = resourceOption;
    self.ruleName = ruleName;
    self.ruleOption = ruleOption;
    self.ruleType = ruleType;
    self.tags = tags;
    self.webHookOption = webHookOption;
    self.alarmId = alarmId;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
baseContact:(NSArray<BaseContact*>*)baseContact
dimension:(NSString*)dimension
enabled:(NSNumber*)enabled
noticeOption:(NSArray<NoticeOption*>*)noticeOption
product:(NSString*)product
resourceOption:(ResourceOption*)resourceOption
ruleName:(NSString*)ruleName
ruleOption:(RuleOption*)ruleOption
ruleType:(NSString*)ruleType
tags:(NSMutableDictionary<NSString*,NSString*>*)tags
webHookOption:(WebHookOption*)webHookOption
alarmId:(NSString*)alarmId { 
    self.regionId = regionId;
    self.version = version;
    self.baseContact = baseContact;
    self.dimension = dimension;
    self.enabled = enabled;
    self.noticeOption = noticeOption;
    self.product = product;
    self.resourceOption = resourceOption;
    self.ruleName = ruleName;
    self.ruleOption = ruleOption;
    self.ruleType = ruleType;
    self.tags = tags;
    self.webHookOption = webHookOption;
    self.alarmId = alarmId;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self baseContact])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self baseContact] count]; i++) {
            BaseContact* item = [[self baseContact] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"baseContact"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self noticeOption])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self noticeOption] count]; i++) {
            NoticeOption* item = [[self noticeOption] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"noticeOption"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self resourceOption])
    {
        [result setValue:[[self resourceOption] dictionary]forKey:@"resourceOption"];
    }
    if([self ruleName])
    {
        [result setValue:[self ruleName] forKey:@"ruleName"];
    }
    if([self ruleOption])
    {
        [result setValue:[[self ruleOption] dictionary]forKey:@"ruleOption"];
    }
    if([self ruleType])
    {
        [result setValue:[self ruleType] forKey:@"ruleType"];
    }
    if([self tags])
    {
        [result setValue:[self tags] forKey:@"tags"];
    }
    if([self webHookOption])
    {
        [result setValue:[[self webHookOption] dictionary]forKey:@"webHookOption"];
    }
    if([self alarmId])
    {
        [result setValue:[self alarmId] forKey:@"alarmId"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* baseContactArray = [dictionary objectForKey:@"baseContact"];
    if(baseContactArray&&![baseContactArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [baseContactArray count];i++)
        {
        BaseContact* item = [[BaseContact alloc]initWithDic:[baseContactArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.baseContact = propertyArray;
    }
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.enabled = [dictionary objectForKey:@"enabled"];
    NSArray* noticeOptionArray = [dictionary objectForKey:@"noticeOption"];
    if(noticeOptionArray&&![noticeOptionArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [noticeOptionArray count];i++)
        {
        NoticeOption* item = [[NoticeOption alloc]initWithDic:[noticeOptionArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.noticeOption = propertyArray;
    }
    self.product = [dictionary objectForKey:@"product"];
    self.resourceOption = [[ResourceOption alloc]initWithDic:[dictionary objectForKey:@"resourceOption"]];
    self.ruleName = [dictionary objectForKey:@"ruleName"];
    self.ruleOption = [[RuleOption alloc]initWithDic:[dictionary objectForKey:@"ruleOption"]];
    self.ruleType = [dictionary objectForKey:@"ruleType"];
    self.tags = [dictionary objectForKey:@"tags"];
    self.webHookOption = [[WebHookOption alloc]initWithDic:[dictionary objectForKey:@"webHookOption"]];
    self.alarmId = [dictionary objectForKey:@"alarmId"];
    return self;
} 

@end
@implementation MonitorDescribeAlarmHistoryRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
isAlarming:(NSNumber*)isAlarming
status:(NSNumber*)status
startTime:(NSString*)startTime
endTime:(NSString*)endTime
ruleType:(NSNumber*)ruleType
ruleName:(NSString*)ruleName
filters:(NSArray<MonitorFilter*>*)filters { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.isAlarming = isAlarming;
    self.status = status;
    self.startTime = startTime;
    self.endTime = endTime;
    self.ruleType = ruleType;
    self.ruleName = ruleName;
    self.filters = filters;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
isAlarming:(NSNumber*)isAlarming
status:(NSNumber*)status
startTime:(NSString*)startTime
endTime:(NSString*)endTime
ruleType:(NSNumber*)ruleType
ruleName:(NSString*)ruleName
filters:(NSArray<MonitorFilter*>*)filters { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.isAlarming = isAlarming;
    self.status = status;
    self.startTime = startTime;
    self.endTime = endTime;
    self.ruleType = ruleType;
    self.ruleName = ruleName;
    self.filters = filters;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self isAlarming])
    {
        [result setValue:[self isAlarming] forKey:@"isAlarming"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self ruleType])
    {
        [result setValue:[self ruleType] forKey:@"ruleType"];
    }
    if([self ruleName])
    {
        [result setValue:[self ruleName] forKey:@"ruleName"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            MonitorFilter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.product = [dictionary objectForKey:@"product"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.isAlarming = [dictionary objectForKey:@"isAlarming"];
    self.status = [dictionary objectForKey:@"status"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.ruleType = [dictionary objectForKey:@"ruleType"];
    self.ruleName = [dictionary objectForKey:@"ruleName"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        MonitorFilter* item = [[MonitorFilter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    return self;
} 

@end
@implementation MonitorDescribeAlarmsRequest
-(id) initWithRegion:(NSString *)regionId
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
ruleName:(NSString*)ruleName
ruleType:(NSNumber*)ruleType
enabled:(NSNumber*)enabled
ruleStatus:(NSNumber*)ruleStatus
filters:(NSArray<MonitorFilter*>*)filters { 
    self.regionId = regionId;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.ruleName = ruleName;
    self.ruleType = ruleType;
    self.enabled = enabled;
    self.ruleStatus = ruleStatus;
    self.filters = filters;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
pageNumber:(NSNumber*)pageNumber
pageSize:(NSNumber*)pageSize
serviceCode:(NSString*)serviceCode
product:(NSString*)product
dimension:(NSString*)dimension
ruleName:(NSString*)ruleName
ruleType:(NSNumber*)ruleType
enabled:(NSNumber*)enabled
ruleStatus:(NSNumber*)ruleStatus
filters:(NSArray<MonitorFilter*>*)filters { 
    self.regionId = regionId;
    self.version = version;
    self.pageNumber = pageNumber;
    self.pageSize = pageSize;
    self.serviceCode = serviceCode;
    self.product = product;
    self.dimension = dimension;
    self.ruleName = ruleName;
    self.ruleType = ruleType;
    self.enabled = enabled;
    self.ruleStatus = ruleStatus;
    self.filters = filters;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self ruleName])
    {
        [result setValue:[self ruleName] forKey:@"ruleName"];
    }
    if([self ruleType])
    {
        [result setValue:[self ruleType] forKey:@"ruleType"];
    }
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self ruleStatus])
    {
        [result setValue:[self ruleStatus] forKey:@"ruleStatus"];
    }
    if([self filters])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self filters] count]; i++) {
            MonitorFilter* item = [[self filters] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"filters"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.product = [dictionary objectForKey:@"product"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.ruleName = [dictionary objectForKey:@"ruleName"];
    self.ruleType = [dictionary objectForKey:@"ruleType"];
    self.enabled = [dictionary objectForKey:@"enabled"];
    self.ruleStatus = [dictionary objectForKey:@"ruleStatus"];
    NSArray* filtersArray = [dictionary objectForKey:@"filters"];
    if(filtersArray&&![filtersArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [filtersArray count];i++)
        {
        MonitorFilter* item = [[MonitorFilter alloc]initWithDic:[filtersArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.filters = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorEnableAlarmsResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorEnableAlarmsResult* result = [[MonitorEnableAlarmsResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorEnableAlarmsResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
@implementation MonitorCreateAlarmRequest
-(id) initWithRegion:(NSString *)regionId
baseContact:(NSArray<BaseContact*>*)baseContact
clientToken:(NSString*)clientToken
dimension:(NSString*)dimension
enabled:(NSNumber*)enabled
noticeOption:(NSArray<NoticeOption*>*)noticeOption
product:(NSString*)product
resourceOption:(ResourceOption*)resourceOption
ruleName:(NSString*)ruleName
ruleOption:(RuleOption*)ruleOption
ruleType:(NSString*)ruleType
tags:(NSMutableDictionary<NSString*,NSString*>*)tags
webHookOption:(WebHookOption*)webHookOption { 
    self.regionId = regionId;
    self.baseContact = baseContact;
    self.clientToken = clientToken;
    self.dimension = dimension;
    self.enabled = enabled;
    self.noticeOption = noticeOption;
    self.product = product;
    self.resourceOption = resourceOption;
    self.ruleName = ruleName;
    self.ruleOption = ruleOption;
    self.ruleType = ruleType;
    self.tags = tags;
    self.webHookOption = webHookOption;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
baseContact:(NSArray<BaseContact*>*)baseContact
clientToken:(NSString*)clientToken
dimension:(NSString*)dimension
enabled:(NSNumber*)enabled
noticeOption:(NSArray<NoticeOption*>*)noticeOption
product:(NSString*)product
resourceOption:(ResourceOption*)resourceOption
ruleName:(NSString*)ruleName
ruleOption:(RuleOption*)ruleOption
ruleType:(NSString*)ruleType
tags:(NSMutableDictionary<NSString*,NSString*>*)tags
webHookOption:(WebHookOption*)webHookOption { 
    self.regionId = regionId;
    self.version = version;
    self.baseContact = baseContact;
    self.clientToken = clientToken;
    self.dimension = dimension;
    self.enabled = enabled;
    self.noticeOption = noticeOption;
    self.product = product;
    self.resourceOption = resourceOption;
    self.ruleName = ruleName;
    self.ruleOption = ruleOption;
    self.ruleType = ruleType;
    self.tags = tags;
    self.webHookOption = webHookOption;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self baseContact])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self baseContact] count]; i++) {
            BaseContact* item = [[self baseContact] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"baseContact"];
    }
    if([self clientToken])
    {
        [result setValue:[self clientToken] forKey:@"clientToken"];
    }
    if([self dimension])
    {
        [result setValue:[self dimension] forKey:@"dimension"];
    }
    if([self enabled])
    {
        [result setValue:[self enabled] forKey:@"enabled"];
    }
    if([self noticeOption])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self noticeOption] count]; i++) {
            NoticeOption* item = [[self noticeOption] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"noticeOption"];
    }
    if([self product])
    {
        [result setValue:[self product] forKey:@"product"];
    }
    if([self resourceOption])
    {
        [result setValue:[[self resourceOption] dictionary]forKey:@"resourceOption"];
    }
    if([self ruleName])
    {
        [result setValue:[self ruleName] forKey:@"ruleName"];
    }
    if([self ruleOption])
    {
        [result setValue:[[self ruleOption] dictionary]forKey:@"ruleOption"];
    }
    if([self ruleType])
    {
        [result setValue:[self ruleType] forKey:@"ruleType"];
    }
    if([self tags])
    {
        [result setValue:[self tags] forKey:@"tags"];
    }
    if([self webHookOption])
    {
        [result setValue:[[self webHookOption] dictionary]forKey:@"webHookOption"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* baseContactArray = [dictionary objectForKey:@"baseContact"];
    if(baseContactArray&&![baseContactArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [baseContactArray count];i++)
        {
        BaseContact* item = [[BaseContact alloc]initWithDic:[baseContactArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.baseContact = propertyArray;
    }
    self.clientToken = [dictionary objectForKey:@"clientToken"];
    self.dimension = [dictionary objectForKey:@"dimension"];
    self.enabled = [dictionary objectForKey:@"enabled"];
    NSArray* noticeOptionArray = [dictionary objectForKey:@"noticeOption"];
    if(noticeOptionArray&&![noticeOptionArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [noticeOptionArray count];i++)
        {
        NoticeOption* item = [[NoticeOption alloc]initWithDic:[noticeOptionArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.noticeOption = propertyArray;
    }
    self.product = [dictionary objectForKey:@"product"];
    self.resourceOption = [[ResourceOption alloc]initWithDic:[dictionary objectForKey:@"resourceOption"]];
    self.ruleName = [dictionary objectForKey:@"ruleName"];
    self.ruleOption = [[RuleOption alloc]initWithDic:[dictionary objectForKey:@"ruleOption"]];
    self.ruleType = [dictionary objectForKey:@"ruleType"];
    self.tags = [dictionary objectForKey:@"tags"];
    self.webHookOption = [[WebHookOption alloc]initWithDic:[dictionary objectForKey:@"webHookOption"]];
    return self;
} 

@end
@implementation MonitorPutMetricDataRequest
-(id) initWithRegion:(NSString *)regionId
metricDataList:(NSArray<MetricDataCm*>*)metricDataList { 
    self.regionId = regionId;
    self.metricDataList = metricDataList;
    return self;
}

-(id) initWithRegion:(NSString *)regionId
             version:(NSString *)version
metricDataList:(NSArray<MetricDataCm*>*)metricDataList { 
    self.regionId = regionId;
    self.version = version;
    self.metricDataList = metricDataList;
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *superObjectDic = [super dictionary];
    if(superObjectDic && [superObjectDic count]>0)
    {
        [result addEntriesFromDictionary:superObjectDic];
    }
    if([self metricDataList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self metricDataList] count]; i++) {
            MetricDataCm* item = [[self metricDataList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"metricDataList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    NSArray* metricDataListArray = [dictionary objectForKey:@"metricDataList"];
    if(metricDataListArray&&![metricDataListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [metricDataListArray count];i++)
        {
        MetricDataCm* item = [[MetricDataCm alloc]initWithDic:[metricDataListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.metricDataList = propertyArray;
    }
    return self;
} 

@end
@implementation MonitorPutMetricDataResult
-(id) initWithSuccess:(NSNumber*) success
        errMetricDataList:(NSArray<MetricDataList*>*)errMetricDataList { 
    self.success = success;               
    self.errMetricDataList = errMetricDataList;               
    return self;
}
-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self success])
    {
        [result setValue:[self success] forKey:@"success"];
    }
    if([self errMetricDataList])
    {
            NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
            for (int i =0 ; i< [[self errMetricDataList] count]; i++) {
            MetricDataList* item = [[self errMetricDataList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"errMetricDataList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.success = [dictionary objectForKey:@"success"];
    NSArray* errMetricDataListArray = [dictionary objectForKey:@"errMetricDataList"];
    if(errMetricDataListArray&&![errMetricDataListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [errMetricDataListArray count];i++)
        {
        MetricDataList* item = [[MetricDataList alloc]initWithDic:[errMetricDataListArray objectAtIndex:i]];
            if(item)
            {
            [propertyArray addObject:item];
            }
        }
        self.errMetricDataList = propertyArray;
    }
    return self;
} 

@end
  
@implementation MonitorPutMetricDataResponse
-(NSMutableDictionary*) dictionary
{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 
    if([self requestId])
    {
        [result setValue:[self requestId] forKey:@"requestId"];
    } 
    if([self result])
    {
        
        [result setValue:[[self result] dictionary] forKey:@"result"];
    }
    if([self error])
    {
        
        [result setValue:[[self error] dictionary] forKey:@"error"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary
{
    
    self.requestId = [dictionary objectForKey:@"requestId"];
MonitorPutMetricDataResult* result = [[MonitorPutMetricDataResult alloc]initWithDic:[dictionary objectForKey:@"result"]];
    self.result = result;
    ServiceError* error = [[ServiceError alloc]initWithDic:[dictionary objectForKey:@"error"]];
    self.error = error;
    return self;
}

-(id) initWithRequestId:(NSString*) requestId
                  error:(ServiceError*) error
                 result:(MonitorPutMetricDataResult*) result
{
    self.error = error;
    self.result =result;
    self.requestId = requestId;
    return self;
}

@end
 
